// cpp_boost.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "thread_pool.h"

struct test_inc
{
	void do_job(std::string str)
	{
		CHAR msg[100] = {0};
		sprintf(msg, "%d - %s", ::GetCurrentThreadId(), str.c_str());
		::OutputDebugStringA(msg);

		::Sleep(100);
	}
};

int _tmain(int argc, _TCHAR* argv[])
{
	{
		thread_pool tp(10);
		test_inc t;
		tp.enqueue(boost::bind(&test_inc::do_job, &t, "test1"));
		tp.enqueue(boost::bind(&test_inc::do_job, &t, "test2"));
	}
	
	::Sleep(10000);

	return 0;
}

